<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@page import="java.io.FileOutputStream"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.io.File"%>
<%@page import="java.io.OutputStream"%>
<html>
<head>
<title>Muzycy.pl - serwis informacyjno usługowy o muzykach</title>
<META HTTP-EQUIV="Content-Type"
	CONTENT="text/html; charset=windows-1250">
<link href="css/styles.css" rel="stylesheet" type="text/css">
</head>
<div id="body">
	
	<div id="menu">
	<div class="logged">
		Zalogowany jako: <b><security:authentication
						property="principal.username" /></b>
		</div>
		<ul>
			<li>
			<a href="mojekonto.htm" class="active"><img src="images/butt_myaccount.jpg" alt="" width="140" height="67" />	</a>
			</li>
			<li>
			<a href="listnews.htm"><img src="images/butt_news.jpg"	alt="" width="100" height="67" /></a>
			</li>
			<li>
			<a href="szukaj.htm"><img src="images/butt_szukajt.jpg" alt="" width="100" height="67" /></a>
			</li>
			<li>
			<a href="logout.htm"><img src="images/butt_logout.jpg" alt="" width="125" height="67" /></a>
			</li>			
		</ul>
		<div class="slogan">
			<img src="images/slogan_szukaj.jpg" alt="" width="594" height="144" />
		</div>
	</div>
	<div id="overview">

		<div id="box">

			<h1>Szukaj newsa</h1><br/>
			<form:form action="searchName.htm">
					<h3>Wpisz tytuł szukanego newsa:</h3> <input type="text" name="searchAdress" />
				<input type="submit" class="myButton2" value="Szukaj">
				<c:if test="${fn:length(resultList) > 0}">
					<br />
					<br />
					<br />
				<h3>Wyniki wyszukiwania:</h3>
						
						<c:forEach items="${resultList}" var="news"
							varStatus="status">
							<br/>
							<h2>${news.title}</h2>
							&nbsp; &nbsp;
							<a href="news.htm?id=${news.id }">Idź do strony newsa...</a><br/>
							
						</c:forEach>
					
				</c:if>
			</form:form>
			<br />
					<br />
					<br />
			<form:form action="searchByTag.htm" >
					<h3>Wybierz tag dla szukanego newsa:</h3> 
					
						
						<select name="tag">
						<c:forEach items="${tagList}" var="tag" >
							<option value="${tag.name}">${tag.name}</option>
						</c:forEach>
						</select>
					
				<input type="submit" class="myButton2" value="Szukaj po tagach">
				<c:if test="${fn:length(resultTagList) > 0}">
					<br />
					<br />
					<br />
				<h3>Wyniki wyszukiwania:</h3>
						
						<c:forEach items="${resultTagList}" var="news"
							varStatus="status">
							<br/>
							<h2>${news.title}</h2>
							&nbsp; &nbsp;
							<a href="news.htm?id=${news.id }">Idź do strony newsa...</a><br/>
							
						</c:forEach>
					
				</c:if>
			</form:form>


		</div>

		<div id="footer" style="margin-left: 0px">
			<div id="copyright">
				Copyright Czesiu. All rights reserved. Design by <a
					href="http://nyan.cat">NyanCat</a>
			</div>
		</div>
	</div>
</div>
</html>